/**
 * Software Analysis and Verification 
 * @project: Verify Pattern Matching with Guards in Scala
 * @authors: Mirco Dotta and Philippe Suter
 */

   
package ch.epfl.lara.patterns.utils

import ch.epfl.lara.patterns.analyze._
import ch.epfl.lara.patterns.ast.{Var,VarSet}

object FreshNameCreator extends Constants { 
  private var counter: Int = 0;

  def fresh(prefix: String): String = {
    counter = counter + 1;
    prefix + FRESH_SEP + counter;
  }
  
  def fresh(prefix: Var): Var = Var(fresh(prefix.name))
  def fresh(prefix: VarSet): VarSet = VarSet(fresh(prefix.name))
  
  def shortFresh(prefix: String): String = fresh(prefix.substring(0,1).toLowerCase)
}
